#ifndef __TASK_H_
#define __TASK_H_

#include "stdint.h"

#define TASK_DEBUG 0

#define LED_LOOP_TASK 0
#define DS1802_TASK 0
#define DS1302_TASK 0
#define LCD1602_TASK 0
#define BUZZER_TASK 0
#define SEGMENT_TASK 0
#define SEGMENT_INTERRUPT_TASK 0
#define I_KEY_TASK 0
#define M_KEY_TASK 0
#define M_LED_TASK 0
#define PCF8591_ADC_TASK 0
#define PCF8591_DAC_TASK 0
#define AT24C02_TASK 0
#define IR1838_TASK 0
#define STEP_MOTOR_TASK 1

/**
 * @brief task_t
 *
 * @param period task period (*10ms)
 * @param tick task tick (*10ms)
 * @param operation task *operation
 */
typedef struct
{
    uint16_t period;         /* !> task period */
    uint16_t tick;           /* !> task tick */
    void (*operation)(void); /* !> task *operation */
} task_t;

void task_creat(void);
uint8_t task_num(void);
task_t *task_handle(void);
void task_schedule(void);

#endif
